<!--
 * createor: zc
 * email: zc8023zs@163.com
 * create_time: 2020/3/14 13:46:24
 *-->
<template>
  <el-container>
    <el-header>
      会员收货地址表详情
    </el-header>
    <el-main>
      <el-form label-width="200px" :inline="true" style="padding:5% 5% 0 5%">
        <el-form-item label="编号：">
          <span>{{formData.id}}</span>
        </el-form-item>
        <el-form-item label="会员ID：">
          <span>{{formData.user_id}}</span>
        </el-form-item>
        <el-form-item label="收货人：">
          <span>{{formData.receive_name}}</span>
        </el-form-item>
        <el-form-item label="详细地址：">
          <span>{{formData.receive_address}}</span>
        </el-form-item>
        <el-form-item label="手机号：">
          <span>{{formData.mobile}}</span>
        </el-form-item>
        <el-form-item label="省份ID：">
          <span>{{formData.province_id}}</span>
        </el-form-item>
        <el-form-item label="城市ID：">
          <span>{{formData.city_id}}</span>
        </el-form-item>
        <el-form-item label="区县ID：">
          <span>{{formData.area_id}}</span>
        </el-form-item>
        <el-form-item label="1默认 0非默认：">
          <span>{{formData.is_default}}</span>
        </el-form-item>
        <el-form-item label="邮编：">
          <span>{{formData.post_num}}</span>
        </el-form-item>
        <el-form-item label="设置一个易记的名称，如：“家里”、“公司“：">
          <span>{{formData.alias}}</span>
        </el-form-item>
      </el-form>
    </el-main>
  </el-container>
</template>
<style scoped>
body .app-container .el-container,
body .app-container .el-header,
body .app-container .el-main,
body .el-container,
body .el-header,
body .el-main {
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
</style>
<script>
import { Loading } from "element-ui";
import {
  jbr_user_addressInfo
} from '@/api/project/wmyh/project_wmyh_jbr_user_address'
export default {
  name: "a_wmyha_jbr_user_address_info",
  data() {
    return {
      infoLoading: false,
      formData:{
        id: 0, 
        user_id: 0, 
        receive_name: '', 
        receive_address: '', 
        mobile: '', 
        province_id: 0, 
        city_id: 0, 
        area_id: 0, 
        is_default: 0, 
        post_num: '', 
        alias: '', 
      }
    };
  },
  activated() {
    var result = location.search.match(new RegExp("[\?\&]id=([^\&]+)", "i"));
    if(result != null || result.length > 0){
      this.onInfo(result[1]);
    }
  },
  methods: {
    onInfo(id){
      this.infoLoading=true;
      jbr_user_addressInfo({id:id}).then(r=>{
        this.formData.id = r.dataSingle.id, 
        this.formData.user_id = r.dataSingle.user_id, 
        this.formData.receive_name = r.dataSingle.receive_name, 
        this.formData.receive_address = r.dataSingle.receive_address, 
        this.formData.mobile = r.dataSingle.mobile, 
        this.formData.province_id = r.dataSingle.province_id, 
        this.formData.city_id = r.dataSingle.city_id, 
        this.formData.area_id = r.dataSingle.area_id, 
        this.formData.is_default = r.dataSingle.is_default, 
        this.formData.post_num = r.dataSingle.post_num, 
        this.formData.alias = r.dataSingle.alias, 
        this.infoLoading=false;
      }).catch(()=>{
        this.infoLoading=false;
      });
    }
  }
}
</script>
